import { findHomeCate } from '@/api/home'

export default {
  namespaced: true,
  state: () => {
    return {
      list: []
    }
  },
  // 修改state
  mutations: {
    setList (state, categoryList) {
      state.list = categoryList
    }
  },
  // 操作异步
  actions: {
    async getList (store) {
      const res = await findHomeCate()
      store.commit('setList', res.result)
    }
  }
}
